package com.wltt.product.ahuthr.controller;

import com.wltt.product.ahuthr.model.ResultData;
import com.wltt.product.ahuthr.model.vo.*;
import com.wltt.product.ahuthr.service.AgreementService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/agreement")
public class AgreementController {

    @Resource
    private AgreementService agreementService;

    /**
     * 查询列表
     *
     * @return
     */
    @RequestMapping(value = {"/listAll"}, method = RequestMethod.POST)
    public ResultData listAll(@RequestBody AgreementListReq agreementListReq) {
        return agreementService.listAll(agreementListReq);
    }

    /**
     * 详情
     *
     * @return
     */
    @RequestMapping(value = {"/detail"}, method = RequestMethod.POST)
    public ResultData detail(@RequestBody AgreementDetailReq agreementDetailReq) {
        return agreementService.detail(agreementDetailReq);
    }

    /**
     * 新增
     *
     * @return
     */
    @RequestMapping(value = {"/add"}, method = RequestMethod.POST)
    public ResultData add(@RequestBody AgreementAddReq agreementAddReq) {
        return agreementService.add(agreementAddReq);
    }

    /**
     * 更新
     *
     * @return
     */
    @RequestMapping(value = {"/update"}, method = RequestMethod.POST)
    public ResultData update(@RequestBody AgreementUpdateReq agreementUpdateReq) {
        return agreementService.update(agreementUpdateReq);
    }

    /**
     * 删除
     *
     * @return
     */
    @RequestMapping(value = {"/delete"}, method = RequestMethod.POST)
    public ResultData delete(@RequestBody AgreementDeleteReq agreementDeleteReq) {
        return agreementService.delete(agreementDeleteReq);
    }
}
